check dictionary is empty or not in python

31

empty_dict = {}
 
if empty_dict:
    print('Dictionary is not empty!')
else:
    print('Dictionary is empty!')

Comments

Submit
0 Comments